Skip to content

Set nearest-neighbor EBSD resampling, and fix ntot calculation in texure.py#33

Merged
AHartmaier merged 1 commit intoICAMS:masterfrom
JXRepo:jun
Apr 9, 2026
Merged

Set nearest-neighbor EBSD resampling, and fix ntot calculation in texure.py#33
AHartmaier merged 1 commit intoICAMS:masterfrom
JXRepo:jun

Conversation

@JXRepo
Copy link
Copy Markdown
Contributor

@JXRepo JXRepo commented Apr 9, 2026

1, The function resample_ebsd_to_rect_grid() in ebsd_hex_grid.py has the defaults parameters k_phase=7, k_iq=7, k_quat=9. I changed to k_phase=1, k_iq=1, k_quat=1.

This makes the hex to rect resampling based on nearest neighbor, so each new pixel takes the value of the closest original EBSD point, instead of mixing several nearby points.

2, I also fixed one error in merge_nodes() in texure.py.
The original code used ntot = len(G.nodes), but that is the number of graph nodes, not the total number of pixels in the two merged grains. It should be:

npix1 = G.nodes[node1]['npix']
npix2 = G.nodes[node2]['npix']
ntot = npix1 + npix2

The merged grain size should be the sum of the two grain pixel counts, which is also needed for the correct weighted update of ori_av.

@AHartmaier AHartmaier merged commit 0e1bf11 into ICAMS:master Apr 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants